<template>
  <div class="table-form">
    <el-form ref="formRef" :model="form" :inline="true" class="pro-select-box">
      <el-form-item label="lotid:" prop="deviceCode">
        <el-input v-model="form.deviceCode" clearable placeholder="lotid" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="query" :loading="loading">查询</el-button>
        <!-- <el-button type='primary' @click='output' :loading='downloading'>导出</el-button> -->
        <el-button type="success" @click="addForm">新增</el-button>
      </el-form-item>
    </el-form>
    <!-- 表格 -->
    <hcTable
      :table-data="list"
      :options="options"
      :columns="tableColumn"
      @size-change="handlerPageSize"
      @current-change="handlerPageIndex"
      @command="handleAction"
    >
    </hcTable>
    <!--<reelInfo :options='editOption' @closeDialog='closeDialog' />  -->
  </div>
</template>

<script setup>
import { reactive } from "vue";
// import reelInfo from "./dialog/reelInfo.vue";
import useQueryTable from "@/hooks/useQueryTable";
import { useI18n } from "vue-i18n";

const { t } = useI18n();
let form = reactive({
  lotid: "",
});

let tableColumn = [
  { type: "index", width: "60", label: "NO.", align: "center", fixed: true },
  { prop: "pid", label: "批次序列号", align: "center" },
  { prop: "lotid", label: "lot号", align: "center" },
  { prop: "recipeName", label: "配方名称", align: "center" },
  { prop: "num", label: "批次数量", align: "center" },
  { prop: "user", label: "操作人", align: "center" },
  { prop: "time", label: "上料时间", align: "center" },
  {
    width: "120",
    label: t("common.operate"),
    align: "center",
    buttons: [
      {
        name: "详情",
        type: "primary",
        command: "detail",
      },
      {
        name: "删除",
        type: "danger",
        command: "ddd",
      },
    ],
  },
];

let {
  list,
  query,
  output,
  addForm,
  options,
  loading,
  editOption,
  downloading,
  closeDialog,
  handleAction,
  handlerPageSize,
  handlerPageIndex,
} = useQueryTable({ get: "/Device/GetPageList", del: "/Device/Delete" }, form);
</script>

<style lang="scss" scoped></style>
